<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            text-align: center;
        }
        li{
            width: 33%;
            list-style: none;
            margin-bottom: 30px;
        }
        li img{
    
            height: 200px;
        }
    </style>
</head>
<body>
    
    <div id="app">
        <ul>
            <li v-for='item in cates' :key='item.id'>
                <h2>{{item.name}}</h2>
                <p>{{item.originalPrice}}</p>
                <img :src="item.pic" alt="">
            </li>
        </ul>
    </div>


    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.13/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script>
        var vm =new Vue({
            el:'#app',
            data:{
                cates:[]
            },
            created(){
                this.fetchCates()
            },
            methods:{
                fetchCates(){
                    axios({
                        method:'post',
                        url:'https://api.it120.cc/conner/shop/goods/list/v2',
                        data:{
                            page:1,
                            pageSize:5
                        }
                    }).then(res=>{
                        if(res.data.code===0){
                            this.cates=res.data.data.result
                            console.log(res.data.data)
                        }
                    })
                }
            }
        
        })
    </script>
</body>
</html>